package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sc.nft.entity.BusinessCardHold;
import com.sc.nft.mapper.BusinessCardHoldMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class BusinessCardHoldDao extends ServiceImpl<BusinessCardHoldMapper, BusinessCardHold> {
    public List<BusinessCardHold> getConfigId(Long configId) {
        LambdaQueryWrapper<BusinessCardHold> wrapper = Wrappers.lambdaQuery();
        wrapper.eq(BusinessCardHold::getConfigId,configId);
        return list(wrapper);
    }

    public void removeByConfigId(Long configId) {
        lambdaUpdate().eq(BusinessCardHold::getConfigId,configId).remove();
    }
}
